﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TecBaseObjects.Base {
    public class TpSetting {

        #region Members

        private object SyncRoot = new object();
        private System.Collections.Hashtable cache = new System.Collections.Hashtable();

        private string settingName;
        private int settingID;
        private int valueTypeID;
        private string settingValue;

        #endregion

        #region Constructor

        public TpSetting(int SettingID, string SettingName, string Value, int ValueType) {
            this.settingID = SettingID;
            this.settingName = SettingName;
            this.settingValue = Value;
            this.valueTypeID = ValueType;
        }

        #endregion

        #region Properties

        #endregion

        #region Methods

        public void SaveSetting<T>(string xPath, T value) {
            lock (SyncRoot) {
                if (cache.ContainsKey(xPath))
                    cache[xPath] = value;
            }

            SaveSettingToDB<T>(xPath, value);
        }

        public void SaveSettingToDB<T>(string xPath, T value) {

        }

        #endregion

    }
}
